package book;

public class Book {
    private String name;
    private String author;
    private int price;
    private String type;
    private boolean is_borrow; //是否被借出，默认初始化为false，表示没有被借出

    public Book(String name, String author, int price, String type) {
        this.name = name;
        this.author = author;
        this.price = price;
        this.type = type;
    }
    public Book() {

    }

    @Override
    public String toString() {
        return "book{" +
                "name='" + name + '\'' +
                ", author='" + author + '\'' +
                ", price=" + price +
                ", type='" + type + '\'' +
                ((is_borrow == true) ? "已被借阅" : "未被借阅")+
                '}';
    }
    public String getName() {
        return this.name;
    }
    public void setName(String name) {
        this.name = name;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public boolean isIs_borrow() {
        return is_borrow;
    }

    public void setIs_borrow(boolean is_borrow) {
        this.is_borrow = is_borrow;
    }
}
